<?php
    // header('Content-type: image/gif');

    include('lzw.php');
    foreach($_GET as $key => $value) {
        $params = decompress($key);
        break;
    }
    $params = explode("&", $params);
    $finalParams = array();
    foreach($params as $param) {
        $paramArr = explode("=", $param);
        $finalParams[$paramArr[0]] = $paramArr[1];
    }
    $live = htmlentities($finalParams['live']);
    $timestamp = htmlentities($finalParams['timestamp']);
    $user_id = htmlentities($finalParams['user_id']);
    $html = urldecode(htmlentities(stripslashes($finalParams['html'])));
    $filename = $timestamp.".".$user_id.".html";
    $flatHandler = fopen("data/pages/".$filename, a);
    fwrite($flatHandler, $html);
    fclose($flatHandler);

    // include('img/tm_pixel.gif');
?>
